<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="author" content="VectorX">
    <meta name="keywords" content="变形平移">
    <title>变形平移</title>
    <style>
        div {
            float: left;
            width: 200px;
            height: 300px;
            background-color: silver;
            margin: 100px 50px auto 50px;
            transition: all .3s;
        }

        div:hover {
            box-shadow: 0 0 10px rgba(0, 0, 0, .2);
            transform: translateY(-5px);
        }

        .
    </style>
</head>

<body>
    <div class="box1"></div>
    <div class="box2"></div>
</body>

</html>